package com.xintonghua.base.ui;

import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;

import com.gyf.barlibrary.ImmersionBar;
import com.xintonghua.base.BuildConfig;
import com.xintonghua.base.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 作者：wanxianyi
 * 时间：2018/1/13.
 * 包名：com.xintonghua.hongyi.ui
 */

public class ImageActivity extends BaseActivity {
    protected ImmersionBar mImmersionBar;
    int image;
    ImageView ivImage,back;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image);

        ButterKnife.bind(this);
        initImmersionBar();
        ivImage=findViewById(R.id.iv_image);
        back=findViewById(R.id.back);
        image = getIntent().getIntExtra(BuildConfig.FLAVOR, 0);
        ivImage.setImageResource(image);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    /**
     * 初始化沉浸式
     */
    protected void initImmersionBar() {
        mImmersionBar = ImmersionBar.with(this);
        mImmersionBar.keyboardEnable(true).navigationBarWithKitkatEnable(false).init();
    }


    @Override
    public void onDestroy() {
        super.onDestroy();
        mImmersionBar.destroy();
    }
}
